package com.javaclimb.music.controller;

import com.javaclimb.music.po.Consumer;
import com.javaclimb.music.service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ConsumerController {
    @Autowired
    private ConsumerService consumerService;

    @RequestMapping(value = "/getConsumerNum",method = RequestMethod.POST)
    public int getConsumerNum() {
        return consumerService.getConsumerNum();
    }

    @RequestMapping(value = "/getConsumerList",method = RequestMethod.POST)
    public List<Consumer> getConsumerList(){
        return consumerService.getConsumerList();
    }
}
